﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections;

namespace Mainform
{
   
    /// <summary>
    /// Interaction logic for ucStartPage.xaml
    /// </summary>
    /// 
    public partial class ucStartPage : UserControl
    {
        public ucStartPage()
        {
            
            InitializeComponent();
            LoadEvaporator();
            LoadCooling();
            LoadCondenser();

            
        }
    
        public void LoadCondenser()
        {
            cbxCondenser.Items.Add("Evaporative Condenser with refrigerant R717");
            cbxCondenser.Items.Add("Air-Cooled condenser with refrigerant R22");
            cbxCondenser.Items.Add("Horizontal pipe codenser with refrigerant R12");
            cbxCondenser.Items.Add("sprinkler condenser with refrigerant R717");
            cbxCondenser.Items.Add("Vertical pipe condenser with refrigerant R717");
            cbxCondenser.SelectedIndex = 0;
        }
        //  Evaporator
        public void LoadCooling()
        {
            cbxCooling.Items.Add("Cooling Tower");
            cbxCooling.SelectedIndex = 0;
        }
        //  Evaporator
        public void LoadEvaporator()
        {
            cbxEvaporator.Items.Add("Casing Pipe Sprinklers");
            cbxEvaporator.Items.Add("Casing Pipe Wing");
            cbxEvaporator.Items.Add("Cooler Wet");
            cbxEvaporator.Items.Add("Plate Amoniac");
            cbxEvaporator.Items.Add("Smooth Pipe R717R22");
            cbxEvaporator.SelectedIndex = 0;

            
        }
        public delegate void AirClick();
        public AirClick MyAir;

        public delegate void ColdClick();
        public ColdClick MyCold;
        //
        public delegate void CoolingClick(int paramenter);
        public CoolingClick MyCooling;

        public delegate void CondenserClick(int paramenter);
        public CondenserClick MyCon;

        public delegate void EvaporatorClick(int paramenter);
        public EvaporatorClick MyEva;

        //  Module 1 
        private void btnHeatLoadEstimation_Click(object sender, RoutedEventArgs e)
        {
            if (rdAir.IsChecked==true)
            {
                MyAir();   

            }
            if (rdCold.IsChecked == true)
            {
                MyCold();
            }

        }
        //  Module 2
        private void btnEquimentDesign_Click(object sender, RoutedEventArgs e)
        {
           
            //
            if (rdEvaporator.IsChecked == true)
            {
                MyEva(cbxEvaporator.SelectedIndex);
              //  MyEva();
            }
            //
            if (rdCondenser.IsChecked == true)
            {
                MyCon(cbxCondenser.SelectedIndex);
            }
            //
            if (rdTower.IsChecked == true)
            {
                MyCooling(cbxCooling.SelectedIndex);
            }
        }
       // 

        //  radio Condenser Checking
        private void rdTower_Checked(object sender, RoutedEventArgs e)
        {
            cbxEvaporator.IsEnabled = false;
            cbxCooling.IsEnabled = true;
            cbxCondenser.IsEnabled = false;
        }
        //  radio Condenser Checking 
        private void rdCondenser_Checked(object sender, RoutedEventArgs e)
        {
            cbxEvaporator.IsEnabled = false;
            cbxCooling.IsEnabled = false;
            cbxCondenser.IsEnabled = true;
        }
        //  Radio  checking 
        private void rdEvaporator_Checked(object sender, RoutedEventArgs e)
        {
            cbxEvaporator.IsEnabled = true;
            cbxCooling.IsEnabled = false;
            cbxCondenser.IsEnabled = false;
        }
       

        private void btnTechnicalDocument_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.Help.ShowHelp(null, ReferencePath.ReferenceFile);
        }

      
    }
}
